#pragma once
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <string>
#include <SDL.h>
#include <SDL_image.h>
#include <sdl_opengl.h>
#include <AL/alut.h>
// inner library
#include "Sound.h"

using namespace std;



class CSettings
{
public:
	CSettings()
	{
		shadows = false;
		isFullscreen = 0;
		win_height = 0;
		win_width = 0;
		def_win_width = 800;
		def_win_height = 600;
		flags = SDL_OPENGL | SDL_DOUBLEBUF;
	}
	void ReadFunc();
	void WriteFunc();
	void ReadKeySet();

	bool shadows;
	bool isFullscreen;
	int def_win_height;
	int def_win_width;
	int win_height;
	int win_width;
	unsigned int flags;
	SDLKey keys[32];
};

class CVideo
{
public:
	CVideo()
	{
		shadow = 0;
	}
	void Init();
	void Draw();
	void VideoSet();
private:
	int shadow;
	CSettings set;
};

class CParticle
{
public:
	CParticle()
	{

	}
void CreatePart(char* name, int partcount, char* Tex);
void SetPosition(char* name, float x, float y, float z);
void KillPart(char* name);
};


class CGame
{
public:
	CGame()
	{
		bpp = 32;
		game_stop = false;
	}
	//void Init();
	void Draw();
	void MainLoop();
	int Run();
	void ProcessEvents();
	void CleanUp();

	CVideo Video;
	CSound Sound;
	

private:
	int bpp;
	bool game_stop;
};
/*
sheets
ifstream in("input");
ofstream out("output");
int n;
in >> n;
out << n << " is the number\n";
in.close();
out.close();

fprintf(stderr, "SDL initialization failed %s\n", SDL_GetError());
*/